package com.atguigu.memento.game;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class GameRole {
    private int attack;
    private int defense;

    public Memento createMemento() {
        return new Memento(attack, defense);
    }

    public void recoverGameRoleFromMemento(Memento memento) {
        this.attack = memento.getAttack();
        this.defense = memento.getDefense();
    }

    public void display() {
        System.out.println("游戏角色\t攻击力：" + this.attack + "\t防御力: " + this.defense);
    }
}
